<template>
    <div>
    
        <van-nav-bar title="咖啡钱包" left-text="返回" left-arrow @click-left="onClickLeft" />
        <div id="ticket">
            <DiscountCoupon v-for="item in list" :key="item.coupon_id" :arr="item" ></DiscountCoupon>
        </div>
        
        <DiscountCouponFooter></DiscountCouponFooter>
    </div>
</template>

<script setup>
// import { useCouponStore } from '@/store/discountCoupon'
import {ref , onMounted} from 'vue'
import { useRouter } from 'vue-router';
import DiscountCoupon from '@/components/discountCoupon/DiscountCoupon.vue';
import DiscountCouponFooter from '@/components/discountCoupon/DiscountCouponFooter.vue';
import { getUserCoupon } from '@/api/api'
const list = ref([])
// import { useBuyNumber } from '@/store/discountCoupon.js'
// const BuyNumber = useBuyNumber()
// const couponStore = useCouponStore()
onMounted(async ()=>{
    const res = await getUserCoupon({uId:11})
    list.value =res.list
    console.log(res.list)
    // BuyNumber.arr = res.list
    // console.log(BuyNumber.arr)
})

const router = useRouter()
const onClickLeft = () => {
    router.back()
}

</script>

<style lang="scss" scoped>
#ticket {
    display: flex;
    flex-wrap: wrap;

}
</style>